package com.car.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.servlet.http.HttpServletRequest;

@Configuration
@Aspect
public class CarAop {

    @Autowired
    HttpServletRequest request;

    @Before("execution (* com.car.controller..*.*(..))")
    public Object before(JoinPoint pro) throws Throwable {
        System.out.println("程序逻辑执行开始："+pro);
        return pro;
    }
    @AfterReturning(returning = "rvt", pointcut = "execution (* com.car.controller..*.*(..))")
    public Object after(JoinPoint pro,Object rvt) throws Throwable {
        System.out.println("程序逻辑执行完毕运行结果："+rvt);
        return pro;
    }

}
